Upload categories specified in the manifest
authorCarol (Nichols || Goulding) <carol.nichols@gmail.com>
Fri, 18 Nov 2016 21:49:55 +0000 (16:49 -0500)
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>
Sat, 3 Dec 2016 16:12:52 +0000 (11:12 -0500)
src/cargo/core/manifest.rs
src/cargo/ops/registry.rs
src/cargo/util/toml.rs
src/crates-io/lib.rs
src/doc/manifest.md

index 93fac21fdf971ff68122ba5ba4cc9677c9da0d0f..e9bc79609e0821e57a12f32ee173c4c805e0ae1e 100644 (file)
@@ -47,6 +47,7 @@ pub struct VirtualManifest {
 pub struct ManifestMetadata {
     pub authors: Vec<String>,
     pub keywords: Vec<String>,
+    pub categories: Vec<String>,
     pub license: Option<String>,
     pub license_file: Option<String>,
     pub description: Option<String>,    // not markdown
index d937976f867acdc86448fcc9c9a208a1e5ef7b83..af80760b63bdaf85abca3ba0d131b32845053e80 100644 (file)
@@ -112,6 +112,7 @@ fn transmit(config: &Config,
     let ManifestMetadata {
         ref authors, ref description, ref homepage, ref documentation,
         ref keywords, ref readme, ref repository, ref license, ref license_file,
+        ref categories,
     } = *manifest.metadata();
     let readme = match *readme {
         Some(ref readme) => Some(paths::read(&pkg.root().join(readme))?),
@@ -142,6 +143,7 @@ fn transmit(config: &Config,
         homepage: homepage.clone(),
         documentation: documentation.clone(),
         keywords: keywords.clone(),
+        categories: categories.clone(),
         readme: readme,
         repository: repository.clone(),
         license: license.clone(),
index 5e5dc93a669e86033d2afd05919b73fe72269bfe..bcac3d2da094357f6253adc036243d9fc4d5135a 100644 (file)
@@ -304,6 +304,7 @@ pub struct TomlProject {
     documentation: Option<String>,
     readme: Option<String>,
     keywords: Option<Vec<String>>,
+    categories: Option<Vec<String>>,
     license: Option<String>,
     license_file: Option<String>,
     repository: Option<String>,
@@ -640,6 +641,7 @@ impl TomlManifest {
             license_file: project.license_file.clone(),
             repository: project.repository.clone(),
             keywords: project.keywords.clone().unwrap_or(Vec::new()),
+            categories: project.categories.clone().unwrap_or(Vec::new()),
         };
 
         let workspace_config = match (self.workspace.as_ref(),
index 884460df2902f944e325cc22f96d575c257e841b..4d8d889f3b44ef8a2db2639a973c77917783fa87 100644 (file)
@@ -78,6 +78,7 @@ pub struct NewCrate {
     pub homepage: Option<String>,
     pub readme: Option<String>,
     pub keywords: Vec<String>,
+    pub categories: Vec<String>,
     pub license: Option<String>,
     pub license_file: Option<String>,
     pub repository: Option<String>,
index 9aaab670738bb15c936cf00d40959d7c79c35915..326cd628cc48135923a3eddda5358a10f71d5e8d 100644 (file)
@@ -118,10 +118,16 @@ repository = "..."
 # contents of this file are stored and indexed in the registry.
 readme = "..."
 
-# This is a small list of keywords used to categorize and search for this
-# package.
+# This is a list of up to five keywords that describe this crate. Keywords
+# are searchable on crates.io, and you may choose any words that would
+# help someone find this crate.
 keywords = ["...", "..."]
 
+# This is a list of up to five categories where this crate would fit.
+# Categories are a fixed list available at crates.io/categories, and
+# they must match exactly.
+categories = ["...", "..."]
+
 # This is a string description of the license for this package. Currently
 # crates.io will validate the license provided against a whitelist of known
 # license identifiers from http://spdx.org/licenses/. Multiple licenses can be